<?php

namespace addons\yiliao;

use app\common\library\Menu;
use think\Addons;

/**
 * 插件
 */
class Yiliao extends Addons
{
    protected $menu=[
        [
            'name'    => 'yiliao',
            'title'   => '医疗服务系统',
            'icon'    => 'fa fa-table',
            'ismenu' => 1,
            'weigh' => 1,
            'sublist' => [
                [
                    'name' => 'yiliao/config',
                    'title' => '系统配置',
                    'remark' => '管理网站的系统配置信息,非开发人员请谨慎使用',
                    'icon' => 'fa fa-sliders',
                    'weigh' => 199,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/config/index', 'title' => '查看'],
                    ],
                ],
                [
                    'name'    => 'yiliao/order',
                    'title'   => '订单管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 100,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/order/index', 'title' => '查看'],
                        ['name' => 'yiliao/order/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/order/del', 'title' => '删除'],
                        ['name' => 'yiliao/order/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/banner',
                    'title'   => 'Banner管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 90,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/banner/index', 'title' => '查看'],
                        ['name' => 'yiliao/banner/add', 'title' => '添加'],
                        ['name' => 'yiliao/banner/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/banner/del', 'title' => '删除'],
                        ['name' => 'yiliao/banner/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/faq',
                    'title'   => '常见问题',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 80,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/faq/index', 'title' => '查看'],
                        ['name' => 'yiliao/faq/add', 'title' => '添加'],
                        ['name' => 'yiliao/faq/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/faq/del', 'title' => '删除'],
                        ['name' => 'yiliao/faq/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/notice',
                    'title'   => '公告',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 70,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/notice/index', 'title' => '查看'],
                        ['name' => 'yiliao/notice/add', 'title' => '添加'],
                        ['name' => 'yiliao/notice/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/notice/del', 'title' => '删除'],
                        ['name' => 'yiliao/notice/multi', 'title' => '批量操作'],
                    ]
                ],
                
                [
                    'name'    => 'yiliao/doctor',
                    'title'   => '医生管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 50,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/doctor/index', 'title' => '查看'],
                        ['name' => 'yiliao/doctor/add', 'title' => '添加'],
                        ['name' => 'yiliao/doctor/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/doctor/del', 'title' => '删除'],
                        ['name' => 'yiliao/doctor/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/procate',
                    'title'   => '项目分类',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 30,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/procate/index', 'title' => '查看'],
                        ['name' => 'yiliao/procate/add', 'title' => '添加'],
                        ['name' => 'yiliao/procate/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/procate/del', 'title' => '删除'],
                        ['name' => 'yiliao/procate/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/pro',
                    'title'   => '项目管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 20,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/pro/index', 'title' => '查看'],
                        ['name' => 'yiliao/pro/add', 'title' => '添加'],
                        ['name' => 'yiliao/pro/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/pro/del', 'title' => '删除'],
                        ['name' => 'yiliao/pro/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/booking',
                    'title'   => '预约管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 18,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/booking/index', 'title' => '查看'],
                        ['name' => 'yiliao/booking/add', 'title' => '添加'],
                        ['name' => 'yiliao/booking/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/booking/del', 'title' => '删除'],
                        ['name' => 'yiliao/booking/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/shop',
                    'title'   => '门店管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 16,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/shop/index', 'title' => '查看'],
                        ['name' => 'yiliao/shop/add', 'title' => '添加'],
                        ['name' => 'yiliao/shop/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/shop/del', 'title' => '删除'],
                        ['name' => 'yiliao/shop/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/promotion',
                    'title'   => '门店活动',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 15,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/promotion/index', 'title' => '查看'],
                        ['name' => 'yiliao/promotion/add', 'title' => '添加'],
                        ['name' => 'yiliao/promotion/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/promotion/del', 'title' => '删除'],
                        ['name' => 'yiliao/promotion/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/newscate',
                    'title'   => '知识分类',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 10,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/newscate/index', 'title' => '查看'],
                        ['name' => 'yiliao/newscate/add', 'title' => '添加'],
                        ['name' => 'yiliao/newscate/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/newscate/del', 'title' => '删除'],
                        ['name' => 'yiliao/newscate/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/news',
                    'title'   => '知识管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 5,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/news/index', 'title' => '查看'],
                        ['name' => 'yiliao/news/add', 'title' => '添加'],
                        ['name' => 'yiliao/news/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/news/del', 'title' => '删除'],
                        ['name' => 'yiliao/news/multi', 'title' => '批量操作'],
                    ]
                ],
				[
                    'name'    => 'yiliao/jfdh',
                    'title'   => '积分兑换',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 4,
                    'ismenu' => 1,
                    'sublist' => [
                        [
							'name'    => 'yiliao/pointcate',
							'title'   => '积分分类',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 10,
							'ismenu' => 1,
							'sublist' => [
								['name' => 'yiliao/pointcate/index', 'title' => '查看'],
								['name' => 'yiliao/pointcate/add', 'title' => '添加'],
								['name' => 'yiliao/pointcate/edit', 'title' => '编辑'],
								['name' => 'yiliao/pointcate/del', 'title' => '删除'],
								['name' => 'yiliao/pointcate/multi', 'title' => '批量操作'],
							]
						],
						[
							'name'    => 'yiliao/pointprd',
							'title'   => '积分商品',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 8,
							'ismenu' => 1,
							'sublist' => [
								['name' => 'yiliao/pointprd/index', 'title' => '查看'],
								['name' => 'yiliao/pointprd/add', 'title' => '添加'],
								['name' => 'yiliao/pointprd/edit', 'title' => '编辑'],
								['name' => 'yiliao/pointprd/del', 'title' => '删除'],
								['name' => 'yiliao/pointprd/multi', 'title' => '批量操作'],
							]
						],
						[
							'name'    => 'yiliao/exorder',
							'title'   => '兑换订单',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 7,
							'ismenu' => 1,
							'sublist' => [
								['name' => 'yiliao/exorder/index', 'title' => '查看'],
								['name' => 'yiliao/exorder/edit', 'title' => '编辑'],
								['name' => 'yiliao/exorder/del', 'title' => '删除'],
							]
						],
						[
							'name'    => 'yiliao/company',
							'title'   => '快递公司',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 6,
							'ismenu' => 1,
							'sublist' => [
								['name' => 'yiliao/company/index', 'title' => '查看'],
								['name' => 'yiliao/company/add', 'title' => '添加'],
								['name' => 'yiliao/company/edit', 'title' => '编辑'],
								['name' => 'yiliao/company/del', 'title' => '删除'],
								['name' => 'yiliao/company/multi', 'title' => '批量操作'],
							]
						],
                    ]
                ],
				[
                    'name'    => 'yiliao/pbgl',
                    'title'   => '排班管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 3,
                    'ismenu' => 1,
                    'sublist' => [
                        [
							'name'    => 'yiliao/pbtimecate',
							'title'   => '排班时间',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 3,
							'ismenu' => 1,
							'sublist' => [
								['name' => 'yiliao/pbtimecate/index', 'title' => '查看'],
								['name' => 'yiliao/pbtimecate/add', 'title' => '添加'],
								['name' => 'yiliao/pbtimecate/edit', 'title' => '编辑'],
								['name' => 'yiliao/pbtimecate/del', 'title' => '删除'],
								['name' => 'yiliao/pbtimecate/multi', 'title' => '批量操作'],
							]
						],
						[
							'name'    => 'yiliao/pbholiday',
							'title'   => '排班请假',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 3,
							'ismenu' => 0,
							'sublist' => [
								['name' => 'yiliao/pbholiday/index', 'title' => '查看'],
								['name' => 'yiliao/pbholiday/add', 'title' => '添加'],
								['name' => 'yiliao/pbholiday/edit', 'title' => '编辑'],
								['name' => 'yiliao/pbholiday/del', 'title' => '删除'],
								['name' => 'yiliao/pbholiday/multi', 'title' => '批量操作'],
							]
						],
						[
							'name'    => 'yiliao/pblist',
							'title'   => '排班管理',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 2,
							'ismenu' => 0,
							'sublist' => [
								['name' => 'yiliao/pblist/index', 'title' => '查看'],
								['name' => 'yiliao/pblist/add', 'title' => '添加'],
								['name' => 'yiliao/pblist/edit', 'title' => '编辑'],
								['name' => 'yiliao/pblist/del', 'title' => '删除'],
								['name' => 'yiliao/pblist/multi', 'title' => '批量操作'],
							]
						],
						[
							'name'    => 'yiliao/pbtime',
							'title'   => '时间段管理',
							'icon'    => 'fa fa-sitemap',
							'weigh' => 2,
							'ismenu' => 0,
							'sublist' => [
								['name' => 'yiliao/pbtime/index', 'title' => '查看'],
								['name' => 'yiliao/pbtime/add', 'title' => '添加'],
								['name' => 'yiliao/pbtime/edit', 'title' => '编辑'],
								['name' => 'yiliao/pbtime/del', 'title' => '删除'],
								['name' => 'yiliao/pbtime/multi', 'title' => '批量操作'],
							]
						],
                    ]
                ],
                [
                    'name'    => 'yiliao/coupon',
                    'title'   => '优惠券',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 3,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/coupon/index', 'title' => '查看'],
                        ['name' => 'yiliao/coupon/add', 'title' => '添加'],
                        ['name' => 'yiliao/coupon/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/coupon/del', 'title' => '删除'],
                        ['name' => 'yiliao/coupon/multi', 'title' => '批量操作'],
                    ]
                ],
                [
                    'name'    => 'yiliao/user',
                    'title'   => '用户管理',
                    'icon'    => 'fa fa-sitemap',
                    'weigh' => 1,
                    'ismenu' => 1,
                    'sublist' => [
                        ['name' => 'yiliao/user/index', 'title' => '查看'],
                        ['name' => 'yiliao/user/edit', 'title' => '编辑'],
                        ['name' => 'yiliao/user/del', 'title' => '删除'],
                        ['name' => 'yiliao/user/multi', 'title' => '批量操作'],
                    ]
                ],
            ]
        ]
    ];
    /**
     * 插件安装方法
     * @return bool
     */
    public function install()
    {
        Menu::create($this->menu);
        return true;
    }

    /**
     * 插件卸载方法
     * @return bool
     */
    public function uninstall()
    {
        Menu::delete('yiliao');
        return true;
    }

    /**
     * 插件启用方法
     * @return bool
     */
    public function enable()
    {
        Menu::enable("yiliao");
        return true;
    }

    /**
     * 插件禁用方法
     * @return bool
     */
    public function disable()
    {
        Menu::disable("yiliao");
        return true;
    }

	/**
     * 插件升级方法
     * @return bool
     */
	public function upgrade()
    {
		Menu::upgrade('yiliao', $this->menu);
	}
}
